﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLDC.Common.Estate;
using System.Configuration;

namespace ZLDC.Estate.CM
{
    public partial class CustomerManager : _PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                UserId.Value = _Utility.GetInfoBySession().m_sUserID;//人员ID;
                deptid.Value = _Utility.GetInfoBySession().m_sDeptID;//部门ID
                station.Value = _Utility.GetInfoBySession().m_sStation;//岗位状态

                btnCompetences();   // 权限控制按钮
            }
        }

        // 权限控制按钮
        private void btnCompetences()
        {                       
            if (!ZLDC.Common.BaseUser.UserInfo.GetPopedom("客源录入"))
                HLAddCustomer.Visible = false;
            if (!ZLDC.Common.BaseUser.UserInfo.GetPopedom("删除客源"))
                btnDelete.Visible = false;
            if (ZLDC.Common.BaseUser.UserInfo.GetPopedom("修改客源"))
                hCompetencesIsEdit.Value = "1";
                btnUpdate.Visible = true;

            if (!ZLDC.Common.BaseUser.UserInfo.GetPopedom("转介客"))
                btnChange.Visible = false;

            string station = _Utility.GetInfoBySession().m_sStation;//岗位状态
            // 经理允许转私客,转公客
            if (_Utility.GetWebConfigSetting("SalesManagerStation").Contains(station) && ZLDC.Common.BaseUser.UserInfo.GetPopedom("转私客"))
            {
                btnInfo1.Visible = true;
                btnInfo2.Visible = true;
            }
        }
    }
}
